import request from '@/utils/request'

// 查询运单列表
export function listWaybills(query) {
  return request({
    url: '/logistics/waybills/list',
    method: 'get',
    params: query
  })
}

// 查询运单详细
export function getWaybills(waybillId) {
  return request({
    url: '/logistics/waybills/' + waybillId,
    method: 'get'
  })
}

// 新增运单
export function addWaybills(data) {
  return request({
    url: '/logistics/waybills',
    method: 'post',
    data: data
  })
}

// 修改运单
export function updateWaybills(data) {
  return request({
    url: '/logistics/waybills',
    method: 'put',
    data: data
  })
}

// 删除运单
export function delWaybills(waybillId) {
  return request({
    url: '/logistics/waybills/' + waybillId,
    method: 'delete'
  })
}


// 司机接单
export function takeOrder(waybillId) {
  return request({
    url: '/logistics/waybills/takeOrder/' + waybillId,
    method: 'post'
  })
}
// 运输完成
export function transportComplete(waybillId) {
  return request({
    url: '/logistics/waybills/transportComplete/' + waybillId,
    method: 'post'
  })
}